<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<title>D 生活</title>
    <%@include file="/views/common/include/taglib.jsp"%>
    <%@include file="/views/common/include/head.jsp"%>
	<link rel="stylesheet" href="${ctx}/css/page/order-list.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/page.css" type="text/css">
	<link rel="stylesheet" href="${ctx}/css/page/header2.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/reset.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/person-left.css" type="text/css">
<link rel="stylesheet" href="${ctx}/css/page/footer.css" type="text/css">

<style type="text/css">
.order-title {
	font-size: 15px;
	color:#000;
	font-weight: 700;
}
.rightlist {
min-height:755px;
}
.rightlist .my-order{
    padding:10px 0px 0 0px;
}
.my-order .order-head{
	padding:10px 0;
}
.order-table-th {
    overflow:hidden;
}
.order-table-th .wp{
    overflow:hidden;
    background:#57B4C6;
}
.order-table-th .th{
    float:left;
    padding:15px 0;
    text-align:center;
}

.th-item{
    width:300px;
}
.th-price{
    width:120px;
}
.th-amount{
    width:125px;
}

.th-op{
    width:135px;
}
</style>
<script src="${ctx}/js/controllers/mall/order/orderListController.js" type="text/javascript"></script>
<script type="text/javascript">
		var ctx = '${ctx}';
		setCtx(ctx);
		
	</script>
</head>
	
<body>
    <jsp:include page="/views/common/head_main.jsp" />
    <div class="bg">
        <div class="contentbox1 contentbox">
        	<div class="leftlist">
		        <div class="myorder left">
		        	<input type="hidden" id="states" value="${states}"/>
					<ul>
						<li><a id="order" class="order" href="${ctx}/orderInfo/orderInfoListByState" <c:if test="${states == '' || states == null}">style="color:red;"</c:if> >我的订单</a></li>
						<li><a class="waitPayMoney" href="${ctx}/orderInfo/orderInfoListByState?states=0" <c:if test="${states == '0'}">style="color:red;"</c:if>>待付款</a></li>
						<li><a class="confirm" href="${ctx}/orderInfo/orderInfoListByState?states=1" <c:if test="${states == '1'}">style="color:red;"</c:if>>待商家确认</a></li>
						<li><a class="sendGoods" href="${ctx}/orderInfo/orderInfoListByState?states=2" <c:if test="${states == '2'}">style="color:red;"</c:if>>待发货</a></li>
						<li><a class="receiveGoods" href="${ctx}/orderInfo/orderInfoListByState?states=3,14" <c:if test="${states == '3,14'}">style="color:red;"</c:if>>待收货</a></li>
						<li><a class="refund" href="${ctx}/orderInfo/orderInfoListByState?states=6,7,8,10,11,12,13" <c:if test="${states == '6,7,8,10,11,12,13'}">style="color:red;"</c:if>>退款售后</a></li>
					</ul>
				</div>
				<div class="myproperty left">
					<ul>
						<li class="order">我的物业</li>
						<c:if test="${displayFeeBill == 1}">
						<li><a href="${ctx}/propertyBill/getMyBill">我的物业费</a></li>
						</c:if>
						<c:if test="${displayCar == 1}">
						<li><a href="${ctx}/carBill/getCarManage">我的停车费</a></li>
						</c:if>
						<li><a href="${ctx}/propertyRepair/infoList">我的物业报修</a></li>
						<li><a href="${ctx}/propertySuggestion/infoList">我的物业投诉</a></li>
					</ul>
				</div>
				<div class="myassets left">
					<ul>
						<li class="order">我的资产</li>
					    <li><a  href="${ctx}/ownerTreasure/ownerIntegralChangeList?state=0&pNo=1">我的积分</a></li>
						<li><a  href="${ctx}/ownerTreasure/getCouponList?pNo=1">优惠券</a></li>
					</ul>
				</div>
				<div class="otherlist left">
					<ul class="others">
						<li class="order">其他</li>
						<li><a  href="${ctx}/ownerOther/getMyCollection">我的收藏</a></li>
						<li><a  href="${ctx}/ownerAddress/ownerAddressList">我的收货地址</a></li>
						<li><a href="${ctx}/complaintsInfo/infoList">我的投诉建议</a></li>
						<li><a href="${ctx}/ownerHouse/ownerHouseList">我的小区</a></li>
						<!-- position需要跳转到特定位置 -->
						<li><a href="${ctx}/main?item=1#openShop">我要开店</a></li>
						<li><a href="${ctx}/usualQuestions/infoList">常见问题</a></li>
					</ul>
				</div>
			</div>
            <%-- <jsp:include page="/views/main/main_personal_left.jsp" /> --%>
           <div class="rightlist" >
           <input type="hidden" id="item" value="${sessionScope.item_personal}"/>
                <div class="my-order">
                    <div class="order-head">
                        <span class="order-title" style="padding-left:20px">我的订单</span>
                        <c:if test="${states == '0'}">
                        <span class="order-title" >&gt;待付款</span>
                        </c:if>
                        <c:if test="${states == '1'}">
                        <span class="order-title" >&gt;待商家确认</span>
                        </c:if>
                        <c:if test="${states == '2'}">
                        <span class="order-title" >&gt;待发货</span>
                        </c:if>
                        <c:if test="${states == '3,14'}">
                        <span class="order-title" >&gt;待收货</span>
                        </c:if>
                        <c:if test="${states == '6,7,8,10,11,12,13'}">
                        <span class="order-title" >&gt;退款售后</span>
                        </c:if>
                        <c:if test="${states == '4,6,7,8,10,11,12,13'}">
                        <span class="order-title" >&gt;待评论</span>
                        </c:if>
                        <input id="states" value="${states}" type="hidden" />
                    </div>
                    
                        <table class="table" id="tab">
                            <thead>
                                <tr>
                                    <th width="30%">商品信息</th>
                                    <th width="10%">单价(元)</th>
                                    <th width="10%">数量</th>
                                    <th width="10%">实付款</th>
                                    <th width="10%">交易状态</th>
                                    <th width="10%">操作</th>
                                </tr>
                            </thead>
                            <tbody id="tableTbody">
                                <c:if test="${not empty orderInfos.list }">
                                    <c:forEach items="${orderInfos.list }" var="orderInfo" varStatus="status">
                                    	<tr><td colspan="6" style="padding:17px 0;"></td></tr>
                                        <tr class="orderTimeShopName">
                                            <td colspan="6"style="border-bottom:1px solid #ccc;">
                                            	<div class="orderTimeShopNameDetail">
                                                    <span <c:if test="${orderInfo.orderLevel == 2 }"> style="padding-left:40px" </c:if>><fmt:formatDate value="${orderInfo.createTime}" pattern="yyyy-MM-dd" /></span>
                                                    <span style="padding-left:10px">订单号：${orderInfo.orderNumber}</span>
	                                                <span  style="padding-left:80px;line-height: 33px;">
	                                                <c:if test="${orderInfo.orderLevel == 2 }">
		                                                <c:if test="${orderInfo.type == 1 }">
		                                                	<img style="vertical-align: -3px;" src="${ctx}/images/gwc/shop.png">&nbsp;${orderInfo.shopName}
		                                                </c:if>
		                                                <c:if test="${orderInfo.type == 2 }">
		                                                	<img style="vertical-align: -3px;" src="${ctx}/images/gwc/shop.png">&nbsp;积分商品
		                                                </c:if>
		                                                <c:if test="${orderInfo.type == 3 }">
		                                                	<img style="vertical-align: -3px;" src="${ctx}/images/gwc/shop.png">&nbsp;秒杀商品
		                                                </c:if>
	                                                </c:if>
	                                                </span>
                                                </div>
                                               
                                            </td>
                                        </tr>
                                        <c:forEach items="${orderInfo.orderDetailList}" var="orderDetailInfo" varStatus="orderDetailStatus">
                                            <tr class="shop-info-tr">
                                                <td class="goods"width="30%">
                                                    <div class="image"style="float: left;">
                                                        <c:if test="${ not empty orderDetailInfo.goodsInfo.logo}">
                                                            <a href="${ctx}/GoodsDetail?id=${orderDetailInfo.goodsId}&type=${orderDetailInfo.goodsInfo.type}" target="_blank">
                                                            	<img width="70px" height="70px" src="${sessionScope.image_logo}${orderDetailInfo.goodsInfo.logo}" />
                                                            </a>
                                                        </c:if>
                                                        <c:if test="${ empty orderDetailInfo.goodsInfo.logo}">
	                                                        <a href="${ctx}/GoodsDetail?id=${orderDetailInfo.goodsId}&type=${orderDetailInfo.goodsInfo.type}" target="_blank">
	                                                            <img width="70px" height="70px" src="${ctx}/images/news/cellManual/default.png" />
	                                                        </a>
                                                        </c:if>
                                                    </div>
                                                    <div style="float:left;">
                                                        <p><span style="float:left;">${orderDetailInfo.goodsInfo.name}</span></p><br/>
                                                        <c:forEach items="${orderDetailInfo.specNameValueList}" var="specNameValue" varStatus="specNameValueStatus">
                                                            <p style="display:inline"><span >${specNameValue.attrName}:</span>
                                                                    <span>${specNameValue.attrValue}</span></p>
                                                        </c:forEach>
                                                    </div>
                                                </td>
                                                <td width="10%">￥${orderDetailInfo.price}</td>
                                                <td width="10%">${orderDetailInfo.amount}</td>
                                                <c:if test="${orderDetailStatus.index == 0 }">
                                                    <td width="10%" style="border-left:1px solid #ccc" rowspan="${fn:length(orderInfo.orderDetailList)}">
                                                        ${orderInfo.finalPrice}<br />
                                                        (含运费${orderInfo.carriage})
                                                    </td>
                                                </c:if>
                                                <c:if test="${orderDetailStatus.index == 0 }">
                                                <td width="10%" style="border-left:1px solid #ccc" rowspan="${fn:length(orderInfo.orderDetailList)}">
                                                	 <c:if test="${orderInfo.state == 3 || orderInfo.state == 14 }">
                                                	      <p>待收货</p></c:if>
                                                	  <c:if test="${orderInfo.state == 9 }">
						                              	  <p>待消费</p>
						                              </c:if>
						                              <c:if test="${orderInfo.state == 0 }">
						                              	  <p>待付款</p>
						                              </c:if>
						                              <c:if test="${orderInfo.state == 1 }">
						                               		<p>待商家确认</p>
					                               	  </c:if>
						                              <c:if test="${orderInfo.state == 2 }">
						                              	    <p>待发货</p></c:if>
						                              <c:if test="${orderInfo.state == 4 }">
					                              	         <p>已完成</p></c:if>
						                              <c:if test="${orderInfo.state == 5 }">
				                              	          	 <p>订单已取消</p></c:if>
						                              <c:if test="${orderInfo.state == 6 }">
						                              	     <p>退款申请</p></c:if>
						                              <c:if test="${orderInfo.state == 7 }">
						                              	 	<p>退款已确认</p></c:if>
						                              <c:if test="${orderInfo.state == 8 }">
						                             	    <p>退款完成</p></c:if>
						                              <c:if test="${orderInfo.state == 10 }">
						                            	    <p>退货申请</p></c:if>
						                              <c:if test="${orderInfo.state == 11 }">
						                              		<p>退货已确认</p></c:if>
						                              <c:if test="${orderInfo.state == 12 }">
						                             		<p>退货已完成</p></c:if>
						                              <c:if test="${orderInfo.state == 13 }">
						                              		<p>退货已拒绝</p></c:if>
                                                    
                                                        <%-- <c:if test="${orderInfo.state == 0}">
                                                            <p>等待买家付款</p>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 9 || orderInfo.state == 14 || orderInfo.state == 3}">
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 1 || orderInfo.state == 2}">
                                                            <p>买家已付款</p>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 4}">
                                                            <p>交易成功</p>
                                                        </c:if>  --%>
                                                        <a title="订单详情" onclick="orderDetail(${orderInfo.id});">订单详情</a>
                                                    </td>
                                                </c:if>
                                                <c:if test="${orderDetailStatus.index == 0 }">
                                                    <td width="10%" style="border-left:1px solid #ccc" rowspan="${fn:length(orderInfo.orderDetailList)}">
                                                        <c:if test="${orderInfo.state == 0}">
                                                            <a class="payMoney"title="立即付款" onclick="payMoney(${orderInfo.id});">立即付款</a>
                                                            <a title="取消订单" onclick="cancelOrder(${orderInfo.id});">取消订单</a>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 14 || orderInfo.state == 3}">
                                                            <a class="comfirm"title="确认收货" onclick="confirmReceiveGoods('${orderInfo.id}');">确认收货</a>
                                                            <a title="投诉卖家" onclick="complainSeller();">投诉卖家</a>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 9 }">
                                                            <a class="comfirm"title="确认收货" onclick="confirmConsume('${orderInfo.id}');">确认消费</a>
                                                            <a title="投诉卖家" onclick="complainSeller();">投诉卖家</a>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 1 || orderInfo.state == 2}">
                                                        	<c:if test="${orderInfo.type == 1}">
	                                                            <a title="申请退款" onclick="applyRefundOrGoods('${orderInfo.id}');">申请退款</a>
	                                                            <br />
                                                            </c:if>
                                                            <a title="投诉卖家" onclick="complainSeller();">投诉卖家</a>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 4}">
                                                        	<c:if test="${orderInfo.type == 1}">
                                                            	<a title="申请退货" onclick="applyRefundOrGoods('${orderInfo.id}');">申请退货</a>
                                                            <br />
                                                            </c:if>
                                                            <input type="hidden" id="shopId" value="${orderDetailInfo.shopId}"/> 
                                                            <a title="投诉卖家" onclick="complainSeller();">投诉卖家</a>
                                                        </c:if> 
                                                        <c:if test="${orderInfo.state == 6 || orderInfo.state == 10}">
                                                            <a title="投诉卖家" onclick="complainSeller();">投诉卖家</a>
                                                        </c:if>
                                                    </td>
                                                </c:if>
                                            </tr>
                        
                                        </c:forEach>
                                    </c:forEach>
                                </c:if>
                            </tbody> 
                            <tfoot>
                                <tr >
                                    <td colspan="6">
                                    	<div class="page">
											<input id="pages" type="hidden" value="${orderInfos.pages}">
											<ul>
												<li><a class="last-page page-change " onclick="gotoPage(${currentPage-1 });">&lt;上一页</a></li>
												<c:if test="${orderInfos.firstPage > 1}">
													<li onclick="gotoPage(1);"
														class="page-num"><a>1</a></li>
													<c:if test="${orderInfos.firstPage > 2}">
						                       		...
						                       		</c:if>
												</c:if>
												<c:forEach items="${orderInfos.navigatepageNums }" var="page">
													<li onclick="gotoPage(${page });"
														class="<c:if test="${currentPage == page }">current</c:if>"
														class="page-num"><a>${page}</a></li>
												</c:forEach>
												<c:if test="${orderInfos.lastPage < orderInfos.pages}">
													<c:if test="${orderInfos.firstPage < orderInfos.pages - 1}">
						                       		...
						                       		</c:if>
													<li onclick="gotoPage(${orderInfos.pages});"
														class="page-num"><a>${orderInfos.pages}</a>
													</li>
												</c:if>
												<li><a class="next-page page-change" onclick="gotoPage(${currentPage+1 });">下一页&gt;</a></li>
											</ul>
										</div>
                                    
                                    
                                    
                                    
                                    
                                    
                                    
<!--                                         <div style="overflow:hidden;padding:15px 0 0 0;"> -->
<!--                                             <div style="float: left;"> -->
<!--                                                 <span class="total" style="padding-left:20px">合计 -->
<%--                                                     ${orderInfos.total} --%>
<!--                                                     条数据</span> -->
<!--                                             </div> -->
<!--                                             <div style="float: right; margin-right: 10px; margin-top: 26px; margin-bottom:50px"> -->
<!--                                                 <div style="float: left;"> -->
<!--                                                     <ul class="footer_ul"> -->
<%--                                                         <c:if test="${orderInfos.hasPreviousPage}"> --%>
<%--                                                             <li onclick="gotoPage(${currentPage-1});"><a  class="leftRight">&lt;&lt;</a></li> --%>
<%--                                                         </c:if> --%>
<%--                                                         <c:if test="${orderInfos.firstPage>1}"> --%>
<!--                                                             <li onclick="gotoPage(1);" -->
<!--                                                                 style="border: 1px solid #9A9A9A;"> -->
<!--                                                                 <a>1</a> -->
<!--                                                             </li> -->
<%--                                                             <c:if --%>
<%--                                                                 test="${orderInfos.firstPage>2}"> --%>
<!-- 			                        		... -->
<%-- 			                        	</c:if> --%>
<%--                                                         </c:if> --%>
<%--                                                         <c:forEach --%>
<%--                                                             items="${orderInfos.navigatepageNums}" --%>
<%--                                                             var="page"> --%>
<!--                                                             <li -->
<%--                                                                 onclick="gotoPage(${page});" --%>
<%--                                                                 class="<c:if test="${currentPage == page }">active</c:if>" --%>
<!--                                                                 style="border: 1px solid #9A9A9A;"> -->
<%--                                                                 <a>${page}</a> --%>
<!--                                                             </li> -->
<%--                                                         </c:forEach> --%>
<%--                                                         <c:if --%>
<%--                                                             test="${orderInfos.lastPage < orderInfos.pages}"> --%>
<%--                                                             <c:if --%>
<%--                                                                 test="${orderInfos.firstPage < orderInfos.pages - 1}"> --%>
<!-- 			                        		... -->
<%-- 			                        	</c:if> --%>
<!--                                                             <li -->
<%--                                                                 onclick="gotoPage(${orderInfos.pages});" --%>
<!--                                                                 style="border: 1px solid #9A9A9A;"> -->
<%--                                                                 <a>${orderInfos.pages}</a> --%>
<!--                                                             </li> -->
<%--                                                         </c:if> --%>
<%--                                                         <c:if --%>
<%--                                                             test="${orderInfos.hasNextPage}"> --%>
<!--                                                             <li><a -->
<%--                                                                 onclick="gotoPage(${currentPage+1});" --%>
<!--                                                                 class="leftRight">&gt;&gt;</a></li> -->
<%--                                                         </c:if> --%>
<!--                                                     </ul> -->
<!--                                                 </div> -->
<!--                                                 <div -->
<!--                                                     style="float: left; height: 30px; line-height: 30px;"> -->
<!--                                                     <span -->
<!--                                                         style="color: #9A9A9A;">跳转到</span> -->
<!--                                                     <input -->
<!--                                                         class="inputclass" -->
<!--                                                         id="pageNo" -->
<!--                                                         onkeydown="if(event.keyCode==13){event.keyCode=0;return false;}" -->
<!--                                                         type="text" -->
<%--                                                         value="${currentPage }" --%>
<!--                                                         style="width: 26px; height: 28px"> -->
<!--                                                     <span -->
<!--                                                         style="color: #9A9A9A;">页</span> -->
<!--                                                     <span -->
<!--                                                         class="buttonclass" -->
<!--                                                         id="J_JumpTo" -->
<!--                                                         onclick="gotoorderInfosPage(null);"><a>GO</a></span> -->
<!--                                                 </div> -->
<!--                                             </div> -->
<!--                                         </div> -->
                                    </td>
                                </tr>
                            </tfoot>
                        </table> 
                    </div>
                </div>
            </div>
        </div>
    <div id="returnAli"></div>
    <jsp:include page="/views/common/footer.jsp" />
	<script src="${ctx}/js/lib/layer/layer.js"></script>
	
	<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>	
</body>
</html>

